home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3308 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.6 KB

  1. Path: info.spt.net.cn!usenet
  2. From: Xu Yifeng <jafd@public.sta.net.cn>
  3. Newsgroups: comp.lang.c++,comp.lang.c,alt.msdos.programmer
  4. Subject: Re: Error with Watcom's Graphics Routines
  5. Date: Tue, 23 Jan 1996 18:38:04 -0800
  6. Organization: Shanghai Post & Telecommunication
  7. Message-ID: <31059B8C.46B6@public.sta.net.cn>
  8. References: <xanthasDLLDBp.LK7@netcom.com>
  9. NNTP-Posting-Host: ts1-25.sta.net.cn
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0b6 (Win16; I)
  14.  
  15. Mike Day wrote:
  16. |> 
  17. |> [ note:  this message is crossposted (because it relates to each) to the
  18. |>   following newsgroups:
  19. |>         comp.lang.c
  20. |>         comp.lang.c++
  21. |>         alt.msdos.programmer ]
  22. |> 
  23. |> Hello...
  24. |> 
  25. |> I believe I have found an error in Watcom's Graphics Routines,
  26. |> specifically, the ones used to detect the video configuration and cursor
  27. |> position.
  28. |> 
  29. |> I have the following code I call a few times throught my program to
  30. |> detect these things:
  31. |> 
  32. |>         // Get dimensions of screen
  33. |>         videoconfig vc;
  34. |>         _getvideoconfig(&vc);
  35. |>         oldrows = rows = vc.numtextrows;
  36. |>         oldcols = cols = vc.numtextcols;
  37. |> 
  38. |>         // Save the screen and position/color
  39. |>         oldcolor = _gettextcolor();
  40. |>         oldbkcolor = _getbkcolor();
  41. |>         screensaved = (rows * cols) << 1;
  42. |>         if (screensave) free(screensave);
  43. |>         screensave = (char *) malloc(screensaved);
  44. |>         if (screensave) memcpy(screensave,(void *)0x000b8000,screensaved);
  45. |>         oldpos = _gettextposition();
  46. |> 
  47. |> I used printf and a delay to see what this code got me each time I ran it,
  48. |> and it always gives me the same values for rows, cols, and oldpos as when
  49. |> I call it at the beginning of the program, even after changing text modes.
  50. |> (80x50, 80x25, etc.)  It seems that watcom only detects this information 
  51. |at
  52. |> the beginning of a program and nowhere thereafter, even when you call its
  53. |> functions.  I am changing the text mode with bios calls, not calls to the
  54. |> watcom graphics library, so perhaps that is a problem...
  55. |> 
  56. |> If you have experienced this problem, have suggestions or a solution,
  57. |> please email me at the address in my .sig.
  58. |> 
  59. |> Thanks.
  60. |> --
  61. |> Mike Day   (Omni-)
  62. |> xanthas@netcom.com
  63.  
  64. It shouldn't be thought as a problem of Watcom C++ graphics library,
  65. it has internal graph driver and maintains some structures, you 
  66. shouldn't bypass the library to change something because the driver
  67. doesn't always call the BIOS. 
  68.    for example, are you always bypass the MS-Windows and directly call
  69. ROM bios when you write Windows program?
  70.  
  71. Good luck,
  72. Xu Yifeng
  73.